package cn.tedu.boot6.mapper;

import cn.tedu.boot6.entity.Image;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ImageMapper {
    @Insert("insert into image values(null,#{intro},#{url})")
    void insert(Image image);

    @Select("select * from image")
    List<Image> select();

    @Select("select url from image where id=#{id}")
    String selectUrlById(int id);

    @Delete("delete from image where id=#{id}")
    void deleteById(int id);
}
